package com.biboheart.demos.random.domain.person;

import com.biboheart.demos.random.domain.PersonDomain;
import com.biboheart.demos.random.executor.Generator;
import com.biboheart.demos.random.executor.IdentityGenerator;
import com.biboheart.demos.random.executor.NameGenerator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RequiredArgsConstructor
public class PersonDomainImpl implements PersonDomain {
    private final NameGenerator nameChinese;
    private final IdentityGenerator idcard;
    private final Generator phone;

    @Override
    public Map<String, Object> generatePersonInfo() {
        String name = nameChinese.generate();
        String id = idcard.generate();
        String phoneNumber = phone.generate();
        return Map.of("name", name, "identity", id, "phone", phoneNumber);
    }

}
